C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################
C
C$OPENAD XXX File_start [head.f]
      SUBROUTINE head(OBJ, G_OBJ0, G_OBJ1, G_OBJ2, G_OBJ3, G_OBJ4, G_OBJ
     +5, X0, X1, X2, X3, X4, X5, H_OBJ0, H_OBJ1, H_OBJ2, H_OBJ3, H_OBJ4,
     + H_OBJ5, H_OBJ6, H_OBJ7, H_OBJ8, H_OBJ9, H_OBJ10, H_OBJ11, H_OBJ12
     +, H_OBJ13, H_OBJ14, H_OBJ15, H_OBJ16, H_OBJ17, H_OBJ18, H_OBJ19, H
     +_OBJ20)
          use OAD_tape
          use OAD_rev
          use OAD_cp

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

      use OAD_active
      use w2f__types
      use oad_intrinsics
      use oad_intrinsics
      use oad_intrinsics
      IMPLICIT NONE
C
C     **** Parameters and Result ****
C
      type(active) :: OBJ
      type(active) :: G_OBJ0
      type(active) :: G_OBJ1
      type(active) :: G_OBJ2
      type(active) :: G_OBJ3
      type(active) :: G_OBJ4
      type(active) :: G_OBJ5
      type(active) :: X0
      type(active) :: X1
      type(active) :: X2
      type(active) :: X3
      type(active) :: X4
      type(active) :: X5
      type(active) :: H_OBJ0
      type(active) :: H_OBJ1
      type(active) :: H_OBJ2
      type(active) :: H_OBJ3
      type(active) :: H_OBJ4
      type(active) :: H_OBJ5
      type(active) :: H_OBJ6
      type(active) :: H_OBJ7
      type(active) :: H_OBJ8
      type(active) :: H_OBJ9
      type(active) :: H_OBJ10
      type(active) :: H_OBJ11
      type(active) :: H_OBJ12
      type(active) :: H_OBJ13
      type(active) :: H_OBJ14
      type(active) :: H_OBJ15
      type(active) :: H_OBJ16
      type(active) :: H_OBJ17
      type(active) :: H_OBJ18
      type(active) :: H_OBJ19
      type(active) :: H_OBJ20
C
C     **** Local Variables and Functions ****
C
      REAL(w2f__8) A
      REAL(w2f__8) AB
      type(active) :: ADJ_M0
      type(active) :: ADJ_M1
      type(active) :: ADJ_M2
      type(active) :: ADJ_M3
      REAL(w2f__8) B
      REAL(w2f__8) BM1
      type(active) :: D00
      type(active) :: D01
      type(active) :: D03
      type(active) :: D11
      type(active) :: D12
      type(active) :: F
      REAL(w2f__8) FOUR3RD
      type(active) :: G
      type(active) :: GG
      type(active) :: LOC1
      type(active) :: LOC2
      type(active) :: M00
      type(active) :: M01
      type(active) :: M02
      type(active) :: M03
      type(active) :: M11
      type(active) :: M12
      type(active) :: M13
      type(active) :: M22
      type(active) :: M23
      type(active) :: M33
      type(active) :: MATR0
      type(active) :: MATR1
      type(active) :: MATR2
      type(active) :: MATR3
      REAL(w2f__8) NORM
      type(active) :: R00
      type(active) :: R02
      type(active) :: R03
      type(active) :: R11
      type(active) :: R12
      type(active) :: R13
      REAL(w2f__8) R22
      REAL(w2f__8) R33
      REAL(w2f__8) SQRT3
      REAL(w2f__8) THIRD
      REAL(w2f__8) TSQRT3
      REAL(w2f__8) TWO3RD
      REAL(w2f__8) TWOSQRT3
      REAL(w2f__8) OpenAD_Symbol_0
      REAL(w2f__8) OpenAD_Symbol_1
      REAL(w2f__8) OpenAD_Symbol_10
      REAL(w2f__8) OpenAD_Symbol_11
      REAL(w2f__8) OpenAD_Symbol_12
      REAL(w2f__8) OpenAD_Symbol_13
      REAL(w2f__8) OpenAD_Symbol_14
      REAL(w2f__8) OpenAD_Symbol_15
      REAL(w2f__8) OpenAD_Symbol_16
      REAL(w2f__8) OpenAD_Symbol_17
      REAL(w2f__8) OpenAD_Symbol_18
      REAL(w2f__8) OpenAD_Symbol_19
      REAL(w2f__8) OpenAD_Symbol_2
      REAL(w2f__8) OpenAD_Symbol_20
      REAL(w2f__8) OpenAD_Symbol_21
      REAL(w2f__8) OpenAD_Symbol_22
      REAL(w2f__8) OpenAD_Symbol_23
      REAL(w2f__8) OpenAD_Symbol_24
      REAL(w2f__8) OpenAD_Symbol_25
      REAL(w2f__8) OpenAD_Symbol_26
      REAL(w2f__8) OpenAD_Symbol_27
      REAL(w2f__8) OpenAD_Symbol_28
      REAL(w2f__8) OpenAD_Symbol_29
      REAL(w2f__8) OpenAD_Symbol_3
      REAL(w2f__8) OpenAD_Symbol_30
      REAL(w2f__8) OpenAD_Symbol_31
      REAL(w2f__8) OpenAD_Symbol_32
      REAL(w2f__8) OpenAD_Symbol_33
      REAL(w2f__8) OpenAD_Symbol_34
      REAL(w2f__8) OpenAD_Symbol_35
      REAL(w2f__8) OpenAD_Symbol_36
      REAL(w2f__8) OpenAD_Symbol_37
      REAL(w2f__8) OpenAD_Symbol_38
      REAL(w2f__8) OpenAD_Symbol_39
      REAL(w2f__8) OpenAD_Symbol_4
      REAL(w2f__8) OpenAD_Symbol_40
      REAL(w2f__8) OpenAD_Symbol_41
      REAL(w2f__8) OpenAD_Symbol_42
      REAL(w2f__8) OpenAD_Symbol_43
      REAL(w2f__8) OpenAD_Symbol_44
      REAL(w2f__8) OpenAD_Symbol_45
      REAL(w2f__8) OpenAD_Symbol_46
      REAL(w2f__8) OpenAD_Symbol_47
      REAL(w2f__8) OpenAD_Symbol_48
      REAL(w2f__8) OpenAD_Symbol_49
      REAL(w2f__8) OpenAD_Symbol_5
      REAL(w2f__8) OpenAD_Symbol_50
      REAL(w2f__8) OpenAD_Symbol_51
      REAL(w2f__8) OpenAD_Symbol_52
      REAL(w2f__8) OpenAD_Symbol_53
      REAL(w2f__8) OpenAD_Symbol_54
      REAL(w2f__8) OpenAD_Symbol_55
      REAL(w2f__8) OpenAD_Symbol_56
      REAL(w2f__8) OpenAD_Symbol_57
      REAL(w2f__8) OpenAD_Symbol_58
      REAL(w2f__8) OpenAD_Symbol_59
      REAL(w2f__8) OpenAD_Symbol_6
      REAL(w2f__8) OpenAD_Symbol_60
      REAL(w2f__8) OpenAD_Symbol_61
      REAL(w2f__8) OpenAD_Symbol_62
      REAL(w2f__8) OpenAD_Symbol_63
      REAL(w2f__8) OpenAD_Symbol_64
      REAL(w2f__8) OpenAD_Symbol_65
      REAL(w2f__8) OpenAD_Symbol_66
      REAL(w2f__8) OpenAD_Symbol_67
      REAL(w2f__8) OpenAD_Symbol_68
      REAL(w2f__8) OpenAD_Symbol_69
      REAL(w2f__8) OpenAD_Symbol_7
      REAL(w2f__8) OpenAD_Symbol_70
      REAL(w2f__8) OpenAD_Symbol_71
      REAL(w2f__8) OpenAD_Symbol_72
      REAL(w2f__8) OpenAD_Symbol_73
      REAL(w2f__8) OpenAD_Symbol_74
      REAL(w2f__8) OpenAD_Symbol_75
      REAL(w2f__8) OpenAD_Symbol_76
      REAL(w2f__8) OpenAD_Symbol_77
      REAL(w2f__8) OpenAD_Symbol_78
      REAL(w2f__8) OpenAD_Symbol_79
      REAL(w2f__8) OpenAD_Symbol_8
      REAL(w2f__8) OpenAD_Symbol_80
      REAL(w2f__8) OpenAD_Symbol_81
      REAL(w2f__8) OpenAD_Symbol_82
      REAL(w2f__8) OpenAD_Symbol_83
      REAL(w2f__8) OpenAD_Symbol_84
      REAL(w2f__8) OpenAD_Symbol_85
      REAL(w2f__8) OpenAD_Symbol_86
      REAL(w2f__8) OpenAD_Symbol_87
      REAL(w2f__8) OpenAD_Symbol_88
      REAL(w2f__8) OpenAD_Symbol_89
      REAL(w2f__8) OpenAD_Symbol_9
      REAL(w2f__8) OpenAD_Symbol_90
      REAL(w2f__8) OpenAD_Symbol_91
      REAL(w2f__8) OpenAD_acc_0
      REAL(w2f__8) OpenAD_acc_1
      REAL(w2f__8) OpenAD_acc_10
      REAL(w2f__8) OpenAD_acc_11
      REAL(w2f__8) OpenAD_acc_12
      REAL(w2f__8) OpenAD_acc_13
      REAL(w2f__8) OpenAD_acc_14
      REAL(w2f__8) OpenAD_acc_15
      REAL(w2f__8) OpenAD_acc_16
      REAL(w2f__8) OpenAD_acc_17
      REAL(w2f__8) OpenAD_acc_2
      REAL(w2f__8) OpenAD_acc_3
      REAL(w2f__8) OpenAD_acc_4
      REAL(w2f__8) OpenAD_acc_5
      REAL(w2f__8) OpenAD_acc_6
      REAL(w2f__8) OpenAD_acc_7
      REAL(w2f__8) OpenAD_acc_8
      REAL(w2f__8) OpenAD_acc_9
      REAL(w2f__8) OpenAD_aux_0
      REAL(w2f__8) OpenAD_aux_1
      REAL(w2f__8) OpenAD_aux_10
      REAL(w2f__8) OpenAD_aux_11
      REAL(w2f__8) OpenAD_aux_12
      REAL(w2f__8) OpenAD_aux_13
      REAL(w2f__8) OpenAD_aux_14
      REAL(w2f__8) OpenAD_aux_2
      REAL(w2f__8) OpenAD_aux_3
      REAL(w2f__8) OpenAD_aux_4
      REAL(w2f__8) OpenAD_aux_5
      REAL(w2f__8) OpenAD_aux_6
      REAL(w2f__8) OpenAD_aux_7
      REAL(w2f__8) OpenAD_aux_8
      REAL(w2f__8) OpenAD_aux_9
      REAL(w2f__8) OpenAD_lin_0
      REAL(w2f__8) OpenAD_lin_1
      REAL(w2f__8) OpenAD_lin_10
      REAL(w2f__8) OpenAD_lin_100
      REAL(w2f__8) OpenAD_lin_101
      REAL(w2f__8) OpenAD_lin_102
      REAL(w2f__8) OpenAD_lin_103
      REAL(w2f__8) OpenAD_lin_104
      REAL(w2f__8) OpenAD_lin_11
      REAL(w2f__8) OpenAD_lin_12
      REAL(w2f__8) OpenAD_lin_13
      REAL(w2f__8) OpenAD_lin_14
      REAL(w2f__8) OpenAD_lin_15
      REAL(w2f__8) OpenAD_lin_16
      REAL(w2f__8) OpenAD_lin_17
      REAL(w2f__8) OpenAD_lin_18
      REAL(w2f__8) OpenAD_lin_19
      REAL(w2f__8) OpenAD_lin_2
      REAL(w2f__8) OpenAD_lin_20
      REAL(w2f__8) OpenAD_lin_21
      REAL(w2f__8) OpenAD_lin_22
      REAL(w2f__8) OpenAD_lin_23
      REAL(w2f__8) OpenAD_lin_24
      REAL(w2f__8) OpenAD_lin_25
      REAL(w2f__8) OpenAD_lin_26
      REAL(w2f__8) OpenAD_lin_27
      REAL(w2f__8) OpenAD_lin_28
      REAL(w2f__8) OpenAD_lin_29
      REAL(w2f__8) OpenAD_lin_3
      REAL(w2f__8) OpenAD_lin_30
      REAL(w2f__8) OpenAD_lin_31
      REAL(w2f__8) OpenAD_lin_32
      REAL(w2f__8) OpenAD_lin_33
      REAL(w2f__8) OpenAD_lin_34
      REAL(w2f__8) OpenAD_lin_35
      REAL(w2f__8) OpenAD_lin_36
      REAL(w2f__8) OpenAD_lin_37
      REAL(w2f__8) OpenAD_lin_38
      REAL(w2f__8) OpenAD_lin_39
      REAL(w2f__8) OpenAD_lin_4
      REAL(w2f__8) OpenAD_lin_40
      REAL(w2f__8) OpenAD_lin_41
      REAL(w2f__8) OpenAD_lin_42
      REAL(w2f__8) OpenAD_lin_43
      REAL(w2f__8) OpenAD_lin_44
      REAL(w2f__8) OpenAD_lin_45
      REAL(w2f__8) OpenAD_lin_46
      REAL(w2f__8) OpenAD_lin_47
      REAL(w2f__8) OpenAD_lin_48
      REAL(w2f__8) OpenAD_lin_49
      REAL(w2f__8) OpenAD_lin_5
      REAL(w2f__8) OpenAD_lin_50
      REAL(w2f__8) OpenAD_lin_51
      REAL(w2f__8) OpenAD_lin_52
      REAL(w2f__8) OpenAD_lin_53
      REAL(w2f__8) OpenAD_lin_54
      REAL(w2f__8) OpenAD_lin_55
      REAL(w2f__8) OpenAD_lin_56
      REAL(w2f__8) OpenAD_lin_57
      REAL(w2f__8) OpenAD_lin_58
      REAL(w2f__8) OpenAD_lin_59
      REAL(w2f__8) OpenAD_lin_6
      REAL(w2f__8) OpenAD_lin_60
      REAL(w2f__8) OpenAD_lin_61
      REAL(w2f__8) OpenAD_lin_62
      REAL(w2f__8) OpenAD_lin_63
      REAL(w2f__8) OpenAD_lin_64
      REAL(w2f__8) OpenAD_lin_65
      REAL(w2f__8) OpenAD_lin_66
      REAL(w2f__8) OpenAD_lin_67
      REAL(w2f__8) OpenAD_lin_68
      REAL(w2f__8) OpenAD_lin_69
      REAL(w2f__8) OpenAD_lin_7
      REAL(w2f__8) OpenAD_lin_70
      REAL(w2f__8) OpenAD_lin_71
      REAL(w2f__8) OpenAD_lin_72
      REAL(w2f__8) OpenAD_lin_73
      REAL(w2f__8) OpenAD_lin_74
      REAL(w2f__8) OpenAD_lin_75
      REAL(w2f__8) OpenAD_lin_76
      REAL(w2f__8) OpenAD_lin_77
      REAL(w2f__8) OpenAD_lin_78
      REAL(w2f__8) OpenAD_lin_79
      REAL(w2f__8) OpenAD_lin_8
      REAL(w2f__8) OpenAD_lin_80
      REAL(w2f__8) OpenAD_lin_81
      REAL(w2f__8) OpenAD_lin_82
      REAL(w2f__8) OpenAD_lin_83
      REAL(w2f__8) OpenAD_lin_84
      REAL(w2f__8) OpenAD_lin_85
      REAL(w2f__8) OpenAD_lin_86
      REAL(w2f__8) OpenAD_lin_87
      REAL(w2f__8) OpenAD_lin_88
      REAL(w2f__8) OpenAD_lin_89
      REAL(w2f__8) OpenAD_lin_9
      REAL(w2f__8) OpenAD_lin_90
      REAL(w2f__8) OpenAD_lin_91
      REAL(w2f__8) OpenAD_lin_92
      REAL(w2f__8) OpenAD_lin_93
      REAL(w2f__8) OpenAD_lin_94
      REAL(w2f__8) OpenAD_lin_95
      REAL(w2f__8) OpenAD_lin_96
      REAL(w2f__8) OpenAD_lin_97
      REAL(w2f__8) OpenAD_lin_98
      REAL(w2f__8) OpenAD_lin_99
      type(active) :: OpenAD_prp_0
      type(active) :: OpenAD_prp_1
      type(active) :: OpenAD_prp_10
      type(active) :: OpenAD_prp_11
      type(active) :: OpenAD_prp_2
      type(active) :: OpenAD_prp_3
      type(active) :: OpenAD_prp_4
      type(active) :: OpenAD_prp_5
      type(active) :: OpenAD_prp_6
      type(active) :: OpenAD_prp_7
      type(active) :: OpenAD_prp_8
      type(active) :: OpenAD_prp_9


C checkpointing stacks and offsets
          integer :: cp_loop_variable_1,cp_loop_variable_2,cp_loop_varia
     +ble_3,cp_loop_variable_4,cp_loop_variable_5,cp_loop_variable_6

C floats 'F'
          double precision, dimension(:), allocatable, save :: theArgFSt
     +ack
          integer, save :: theArgFStackoffset=0, theArgFStackSize=0
C integers 'I'
          integer, dimension(:), allocatable, save :: theArgIStack
          integer, save :: theArgIStackoffset=0, theArgIStackSize=0
C booleans 'B'
          logical, dimension(:), allocatable, save :: theArgBStack
          integer, save :: theArgBStackoffset=0, theArgBStackSize=0
C strings 'S'
          character*(80), dimension(:), allocatable, save :: theArgSStac
     +k
          integer, save :: theArgSStackoffset=0, theArgSStackSize=0

          type(modeType) :: our_orig_mode

C external C function used in inlined code
          integer iaddr
          external iaddr
C
C     **** Top Level Pragmas ****
C
C$OPENAD INDEPENDENT(X0)
C$OPENAD INDEPENDENT(X1)
C$OPENAD INDEPENDENT(X2)
C$OPENAD INDEPENDENT(X3)
C$OPENAD INDEPENDENT(X4)
C$OPENAD INDEPENDENT(X5)
C$OPENAD DEPENDENT(OBJ)
C$OPENAD DEPENDENT(G_OBJ0)
C$OPENAD DEPENDENT(G_OBJ1)
C$OPENAD DEPENDENT(G_OBJ2)
C$OPENAD DEPENDENT(G_OBJ3)
C$OPENAD DEPENDENT(G_OBJ4)
C$OPENAD DEPENDENT(G_OBJ5)
C$OPENAD DEPENDENT(H_OBJ0)
C$OPENAD DEPENDENT(H_OBJ1)
C$OPENAD DEPENDENT(H_OBJ2)
C$OPENAD DEPENDENT(H_OBJ3)
C$OPENAD DEPENDENT(H_OBJ4)
C$OPENAD DEPENDENT(H_OBJ5)
C$OPENAD DEPENDENT(H_OBJ6)
C$OPENAD DEPENDENT(H_OBJ7)
C$OPENAD DEPENDENT(H_OBJ8)
C$OPENAD DEPENDENT(H_OBJ9)
C$OPENAD DEPENDENT(H_OBJ10)
C$OPENAD DEPENDENT(H_OBJ11)
C$OPENAD DEPENDENT(H_OBJ12)
C$OPENAD DEPENDENT(H_OBJ13)
C$OPENAD DEPENDENT(H_OBJ14)
C$OPENAD DEPENDENT(H_OBJ15)
C$OPENAD DEPENDENT(H_OBJ16)
C$OPENAD DEPENDENT(H_OBJ17)
C$OPENAD DEPENDENT(H_OBJ18)
C$OPENAD DEPENDENT(H_OBJ19)
C$OPENAD DEPENDENT(H_OBJ20)
C
C     **** Statements ****
C

          if (our_rev_mode%arg_store) then
C store arguments
          end if
          if (our_rev_mode%arg_restore) then
C restore arguments
          end if
          if (our_rev_mode%plain) then
            our_orig_mode=our_rev_mode
            our_rev_mode%arg_store=.FALSE.
C original function
C$OPENAD XXX Template ad_template.f
      A = 5.0D-01
      B = (-1.0D00)
      AB = (A * B)
      SQRT3 = 5.77350269189625842081D-01
      TSQRT3 = 1.15470053837925168416D00
      TWOSQRT3 = 1.15470053837925168416D00
      THIRD = 3.3333333333333331483D-01
      TWO3RD = 6.66666666666666629659D-01
      FOUR3RD = 1.33333333333333325932D00
      BM1 = (-2.0D00)
      MATR0%v = (X1%v-X0%v)
      MATR1%v = (SQRT3*(X2%v*2.0D00-X1%v-X0%v))
      MATR2%v = (X4%v-X3%v)
      MATR3%v = (SQRT3*(X5%v*2.0D00-X4%v-X3%v))
      M03%v = (MATR0%v*MATR3%v)
      M12%v = (MATR1%v*MATR2%v)
      G%v = (M03%v-M12%v)
      D00%v = (M03%v*2.0D00)
      D11%v = (M12%v*2.0D00)
      M00%v = (MATR0%v*MATR0%v)
      M11%v = (MATR1%v*MATR1%v)
      M22%v = (MATR2%v*MATR2%v)
      M33%v = (MATR3%v*MATR3%v)
      D12%v = (M00%v*M33%v)
      D03%v = (M11%v*M22%v)
      F%v = (D03%v+D12%v)
      NORM = F%v
      LOC1%v = (A*(1.0D00/G%v))
      OBJ%v = (F%v*LOC1%v)
      LOC2%v = (AB*(1.0D00/(G%v*G%v)))
      GG%v = (AB*B*(1.0D00/(G%v*G%v*G%v)))
      G%v = (F%v*LOC2%v)
      F%v = (LOC1%v*2.0D00)
      ADJ_M0%v = (F%v*MATR0%v+G%v*MATR3%v)
      ADJ_M1%v = (F%v*MATR1%v-G%v*MATR2%v)
      ADJ_M2%v = (F%v*MATR2%v-G%v*MATR1%v)
      ADJ_M3%v = (F%v*MATR3%v+G%v*MATR0%v)
      LOC1%v = (ADJ_M1%v*SQRT3)
      G_OBJ0%v = (-(ADJ_M0%v+LOC1%v))
      G_OBJ1%v = (ADJ_M0%v-LOC1%v)
      G_OBJ2%v = (LOC1%v*2.0D00)
      LOC1%v = (ADJ_M3%v*SQRT3)
      G_OBJ3%v = (-(ADJ_M2%v+LOC1%v))
      G_OBJ4%v = (ADJ_M2%v-LOC1%v)
      G_OBJ5%v = (LOC1%v*2.0D00)
      LOC2%v = (LOC2%v*2.0D00)
      R00%v = (D00%v*LOC2%v+GG%v*M33%v)
      R11%v = (D11%v*LOC2%v+GG%v*M22%v)
      R22 = (D11%v*LOC2%v+GG%v*M11%v)
      R33 = (D00%v*LOC2%v+GG%v*M00%v)
      M01%v = (MATR0%v*MATR1%v)
      M02%v = (MATR0%v*MATR2%v)
      M12%v = (MATR1%v*MATR2%v)
      M13%v = (MATR1%v*MATR3%v)
      M23%v = (MATR2%v*MATR3%v)
      D01%v = (LOC2%v*(M02%v+M13%v))
      LOC1%v = (R11%v*THIRD)
      F%v = (TWOSQRT3*(D01%v+GG%v*M23%v))
      G%v = (LOC1%v+R00%v)
      H_OBJ1%v = (LOC1%v-R00%v)
      H_OBJ0%v = (F%v+G%v)
      H_OBJ3%v = (G%v-F%v)
      LOC1%v = (-(R11%v*TWO3RD))
      H_OBJ2%v = (LOC1%v-F%v)
      H_OBJ4%v = (F%v+LOC1%v)
      H_OBJ5%v = (FOUR3RD*R11%v)
      LOC1%v = (R00%v*THIRD)
      F%v = (TWOSQRT3*(D01%v+GG%v*M01%v))
      G%v = (LOC1%v+R11%v)
      H_OBJ16%v = (LOC1%v-R11%v)
      H_OBJ15%v = (F%v+G%v)
      H_OBJ18%v = (G%v-F%v)
      LOC1%v = (-(R00%v*TWO3RD))
      H_OBJ17%v = (LOC1%v-F%v)
      H_OBJ19%v = (F%v+LOC1%v)
      H_OBJ20%v = (FOUR3RD*R00%v)
      LOC1%v = (LOC2%v*(M01%v+M23%v))
      R13%v = (LOC1%v+GG%v*M02%v)
      R02%v = (LOC1%v+GG%v*M13%v)
      R03%v = (D03%v*LOC2%v+GG%v*M03%v)
      R12%v = (D12%v*LOC2%v+GG%v*M12%v)
      G%v = (-(R13%v*TWO3RD))
      F%v = (R03%v*TWOSQRT3)
      H_OBJ8%v = (G%v-F%v)
      H_OBJ11%v = (F%v+G%v)
      F%v = (R12%v*TWOSQRT3)
      H_OBJ12%v = (G%v-F%v)
      H_OBJ13%v = (F%v+G%v)
      H_OBJ14%v = (R13%v*1.2D+01)
      G%v = (FOUR3RD*R02%v)
      F%v = (SQRT3*(R03%v+R12%v))
      H_OBJ10%v = (G%v-F%v)
      H_OBJ6%v = (F%v+G%v)
      G%v = (R02%v*TWO3RD)
      F%v = (SQRT3*(R03%v-R12%v))
      H_OBJ9%v = (G%v-F%v)
      H_OBJ7%v = (F%v+G%v)

C original function end
            our_rev_mode=our_orig_mode
          end if
          if (our_rev_mode%tape) then
C            print*, " tape       ", our_rev_mode
            our_rev_mode%arg_store=.TRUE.
            our_rev_mode%arg_restore=.FALSE.
            our_rev_mode%plain=.TRUE.
            our_rev_mode%tape=.FALSE.
            our_rev_mode%adjoint=.FALSE.
C taping
C$OPENAD XXX Template ad_template.f
      A = 5.0D-01
      B = (-1.0D00)
      AB = (A*B)
      SQRT3 = 5.77350269189625842081D-01
      TSQRT3 = 1.15470053837925168416D00
      TWOSQRT3 = 1.15470053837925168416D00
      THIRD = 3.3333333333333331483D-01
      TWO3RD = 6.66666666666666629659D-01
      FOUR3RD = 1.33333333333333325932D00
      BM1 = (-2.0D00)
      MATR0%v = (X1%v-X0%v)
      OpenAD_aux_0 = (X2%v*2.0D00-X1%v-X0%v)
      OpenAD_lin_0 = SQRT3
      MATR1%v = (SQRT3*OpenAD_aux_0)
      MATR2%v = (X4%v-X3%v)
      OpenAD_aux_1 = (X5%v*2.0D00-X4%v-X3%v)
      OpenAD_lin_1 = SQRT3
      MATR3%v = (SQRT3*OpenAD_aux_1)
      OpenAD_lin_2 = MATR3%v
      OpenAD_lin_3 = MATR0%v
      M03%v = (MATR0%v*MATR3%v)
      OpenAD_lin_4 = MATR2%v
      OpenAD_lin_5 = MATR1%v
      M12%v = (MATR1%v*MATR2%v)
      G%v = (M03%v-M12%v)
      D00%v = (M03%v*2.0D00)
      D11%v = (M12%v*2.0D00)
      OpenAD_lin_6 = MATR0%v
      OpenAD_lin_7 = MATR0%v
      M00%v = (MATR0%v*MATR0%v)
      OpenAD_lin_8 = MATR1%v
      OpenAD_lin_9 = MATR1%v
      M11%v = (MATR1%v*MATR1%v)
      OpenAD_lin_10 = MATR2%v
      OpenAD_lin_11 = MATR2%v
      M22%v = (MATR2%v*MATR2%v)
      OpenAD_lin_12 = MATR3%v
      OpenAD_lin_13 = MATR3%v
      M33%v = (MATR3%v*MATR3%v)
      OpenAD_lin_14 = M33%v
      OpenAD_lin_15 = M00%v
      D12%v = (M00%v*M33%v)
      OpenAD_lin_16 = M22%v
      OpenAD_lin_17 = M11%v
      D03%v = (M11%v*M22%v)
      F%v = (D03%v+D12%v)
      NORM = F%v
      OpenAD_aux_2 = (1.0D00/G%v)
      OpenAD_lin_19 = (-(1.0D00/(G%v*G%v)))
      OpenAD_lin_18 = A
      LOC1%v = (A*OpenAD_aux_2)
      OpenAD_lin_20 = LOC1%v
      OpenAD_lin_21 = F%v
      OBJ%v = (F%v*LOC1%v)
      OpenAD_aux_4 = (G%v*G%v)
      OpenAD_aux_3 = (1.0D00/OpenAD_aux_4)
      OpenAD_lin_24 = G%v
      OpenAD_lin_25 = G%v
      OpenAD_lin_23 = (-(1.0D00/(OpenAD_aux_4*OpenAD_aux_4)))
      OpenAD_lin_22 = AB
      LOC2%v = (AB*OpenAD_aux_3)
      OpenAD_aux_5 = (AB*B)
      OpenAD_aux_8 = (G%v*G%v)
      OpenAD_aux_7 = (G%v*OpenAD_aux_8)
      OpenAD_aux_6 = (1.0D00/OpenAD_aux_7)
      OpenAD_lin_28 = OpenAD_aux_8
      OpenAD_lin_30 = G%v
      OpenAD_lin_31 = G%v
      OpenAD_lin_29 = G%v
      OpenAD_lin_27 = (-(1.0D00/(OpenAD_aux_7*OpenAD_aux_7)))
      OpenAD_lin_26 = OpenAD_aux_5
      GG%v = (OpenAD_aux_5*OpenAD_aux_6)
      OpenAD_acc_0 = (OpenAD_lin_19*OpenAD_lin_18)
      OpenAD_acc_1 = (OpenAD_lin_6+OpenAD_lin_7)
      OpenAD_acc_2 = (OpenAD_lin_8+OpenAD_lin_9)
      OpenAD_acc_3 = (OpenAD_lin_10+OpenAD_lin_11)
      OpenAD_acc_4 = (OpenAD_lin_12+OpenAD_lin_13)
      OpenAD_acc_5 = ((OpenAD_lin_28+(OpenAD_lin_30+OpenAD_lin_31)*OpenA
     +D_lin_29)*OpenAD_lin_27*OpenAD_lin_26)
      OpenAD_acc_6 = ((OpenAD_lin_24+OpenAD_lin_25)*OpenAD_lin_23*OpenAD
     +_lin_22)
      double_tape(double_tape_pointer) = OpenAD_acc_1
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_3
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_0
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_1
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_2
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_3
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_4
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_5
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_2
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_4
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_14
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_15
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_16
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_17
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_0
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_20
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_21
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_6
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_5
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_32 = LOC2%v
      OpenAD_lin_33 = F%v
      G%v = (F%v*LOC2%v)
      F%v = (LOC1%v*2.0D00)
      OpenAD_lin_34 = MATR0%v
      OpenAD_lin_35 = F%v
      OpenAD_lin_36 = MATR3%v
      OpenAD_lin_37 = G%v
      ADJ_M0%v = (F%v*MATR0%v+G%v*MATR3%v)
      OpenAD_lin_38 = MATR1%v
      OpenAD_lin_39 = F%v
      OpenAD_lin_40 = MATR2%v
      OpenAD_lin_41 = G%v
      ADJ_M1%v = (F%v*MATR1%v-G%v*MATR2%v)
      OpenAD_lin_42 = MATR2%v
      OpenAD_lin_43 = F%v
      OpenAD_lin_44 = MATR1%v
      OpenAD_lin_45 = G%v
      ADJ_M2%v = (F%v*MATR2%v-G%v*MATR1%v)
      OpenAD_lin_46 = MATR3%v
      OpenAD_lin_47 = F%v
      OpenAD_lin_48 = MATR0%v
      OpenAD_lin_49 = G%v
      ADJ_M3%v = (F%v*MATR3%v+G%v*MATR0%v)
      OpenAD_lin_50 = SQRT3
      LOC1%v = (ADJ_M1%v*SQRT3)
      G_OBJ0%v = (-(ADJ_M0%v+LOC1%v))
      G_OBJ1%v = (ADJ_M0%v-LOC1%v)
      G_OBJ2%v = (LOC1%v*2.0D00)
      OpenAD_acc_7 = (2.0D00*OpenAD_lin_34)
      OpenAD_acc_8 = (2.0D00*OpenAD_lin_38)
      OpenAD_acc_9 = (OpenAD_lin_40*INT((-1_w2f__i8)))
      OpenAD_acc_10 = (OpenAD_lin_41*INT((-1_w2f__i8)))
      OpenAD_acc_11 = (2.0D00*OpenAD_lin_42)
      OpenAD_acc_12 = (OpenAD_lin_44*INT((-1_w2f__i8)))
      OpenAD_acc_13 = (OpenAD_lin_45*INT((-1_w2f__i8)))
      OpenAD_acc_14 = (2.0D00*OpenAD_lin_46)
      double_tape(double_tape_pointer) = OpenAD_lin_32
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_33
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_35
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_7
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_36
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_37
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_39
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_8
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_9
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_10
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_43
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_11
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_12
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_13
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_47
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_14
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_48
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_49
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_50
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_51 = SQRT3
      LOC1%v = (ADJ_M3%v*SQRT3)
      G_OBJ3%v = (-(ADJ_M2%v+LOC1%v))
      G_OBJ4%v = (ADJ_M2%v-LOC1%v)
      G_OBJ5%v = (LOC1%v*2.0D00)
      LOC2%v = (LOC2%v*2.0D00)
      OpenAD_lin_52 = LOC2%v
      OpenAD_lin_53 = D00%v
      OpenAD_lin_54 = M33%v
      OpenAD_lin_55 = GG%v
      R00%v = (D00%v*LOC2%v+GG%v*M33%v)
      OpenAD_lin_56 = LOC2%v
      OpenAD_lin_57 = D11%v
      OpenAD_lin_58 = M22%v
      OpenAD_lin_59 = GG%v
      R11%v = (D11%v*LOC2%v+GG%v*M22%v)
      R22 = (D11%v*LOC2%v+GG%v*M11%v)
      R33 = (D00%v*LOC2%v+GG%v*M00%v)
      OpenAD_lin_60 = MATR1%v
      OpenAD_lin_61 = MATR0%v
      M01%v = (MATR0%v*MATR1%v)
      OpenAD_lin_62 = MATR2%v
      OpenAD_lin_63 = MATR0%v
      M02%v = (MATR0%v*MATR2%v)
      OpenAD_lin_64 = MATR2%v
      OpenAD_lin_65 = MATR1%v
      M12%v = (MATR1%v*MATR2%v)
      OpenAD_lin_66 = MATR3%v
      OpenAD_lin_67 = MATR1%v
      M13%v = (MATR1%v*MATR3%v)
      OpenAD_lin_68 = MATR3%v
      OpenAD_lin_69 = MATR2%v
      M23%v = (MATR2%v*MATR3%v)
      OpenAD_aux_9 = (M02%v+M13%v)
      OpenAD_lin_70 = OpenAD_aux_9
      OpenAD_lin_71 = LOC2%v
      D01%v = (LOC2%v*OpenAD_aux_9)
      double_tape(double_tape_pointer) = OpenAD_lin_51
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_60
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_61
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_62
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_63
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_64
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_65
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_66
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_67
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_68
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_69
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_52
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_53
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_54
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_55
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_56
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_57
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_58
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_59
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_70
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_71
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_72 = THIRD
      LOC1%v = (R11%v*THIRD)
      OpenAD_aux_10 = (D01%v+GG%v*M23%v)
      OpenAD_lin_74 = M23%v
      OpenAD_lin_75 = GG%v
      OpenAD_lin_73 = TWOSQRT3
      F%v = (TWOSQRT3*OpenAD_aux_10)
      G%v = (LOC1%v+R00%v)
      H_OBJ1%v = (LOC1%v-R00%v)
      H_OBJ0%v = (F%v+G%v)
      H_OBJ3%v = (G%v-F%v)
      double_tape(double_tape_pointer) = OpenAD_lin_72
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_74
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_75
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_73
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_76 = TWO3RD
      LOC1%v = (-(R11%v*TWO3RD))
      H_OBJ2%v = (LOC1%v-F%v)
      H_OBJ4%v = (F%v+LOC1%v)
      OpenAD_lin_77 = FOUR3RD
      H_OBJ5%v = (FOUR3RD*R11%v)
      OpenAD_acc_15 = (OpenAD_lin_76*INT((-1_w2f__i8)))
      double_tape(double_tape_pointer) = OpenAD_lin_77
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_15
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_78 = THIRD
      LOC1%v = (R00%v*THIRD)
      OpenAD_aux_11 = (D01%v+GG%v*M01%v)
      OpenAD_lin_80 = M01%v
      OpenAD_lin_81 = GG%v
      OpenAD_lin_79 = TWOSQRT3
      F%v = (TWOSQRT3*OpenAD_aux_11)
      G%v = (LOC1%v+R11%v)
      H_OBJ16%v = (LOC1%v-R11%v)
      H_OBJ15%v = (F%v+G%v)
      H_OBJ18%v = (G%v-F%v)
      double_tape(double_tape_pointer) = OpenAD_lin_78
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_80
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_81
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_79
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_82 = TWO3RD
      LOC1%v = (-(R00%v*TWO3RD))
      H_OBJ17%v = (LOC1%v-F%v)
      H_OBJ19%v = (F%v+LOC1%v)
      OpenAD_lin_83 = FOUR3RD
      H_OBJ20%v = (FOUR3RD*R00%v)
      OpenAD_acc_16 = (OpenAD_lin_82*INT((-1_w2f__i8)))
      double_tape(double_tape_pointer) = OpenAD_lin_83
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_16
      double_tape_pointer = double_tape_pointer+1
      OpenAD_aux_12 = (M01%v+M23%v)
      OpenAD_lin_84 = OpenAD_aux_12
      OpenAD_lin_85 = LOC2%v
      LOC1%v = (LOC2%v*OpenAD_aux_12)
      OpenAD_lin_86 = M02%v
      OpenAD_lin_87 = GG%v
      R13%v = (LOC1%v+GG%v*M02%v)
      OpenAD_lin_88 = M13%v
      OpenAD_lin_89 = GG%v
      R02%v = (LOC1%v+GG%v*M13%v)
      OpenAD_lin_90 = LOC2%v
      OpenAD_lin_91 = D03%v
      OpenAD_lin_92 = M03%v
      OpenAD_lin_93 = GG%v
      R03%v = (D03%v*LOC2%v+GG%v*M03%v)
      OpenAD_lin_94 = LOC2%v
      OpenAD_lin_95 = D12%v
      OpenAD_lin_96 = M12%v
      OpenAD_lin_97 = GG%v
      R12%v = (D12%v*LOC2%v+GG%v*M12%v)
      OpenAD_lin_98 = TWO3RD
      G%v = (-(R13%v*TWO3RD))
      OpenAD_lin_99 = TWOSQRT3
      F%v = (R03%v*TWOSQRT3)
      H_OBJ8%v = (G%v-F%v)
      H_OBJ11%v = (F%v+G%v)
      OpenAD_acc_17 = (OpenAD_lin_98*INT((-1_w2f__i8)))
      double_tape(double_tape_pointer) = OpenAD_lin_84
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_85
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_86
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_87
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_88
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_89
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_90
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_91
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_92
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_93
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_94
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_95
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_96
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_97
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_99
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_acc_17
      double_tape_pointer = double_tape_pointer+1
      OpenAD_lin_100 = TWOSQRT3
      F%v = (R12%v*TWOSQRT3)
      H_OBJ12%v = (G%v-F%v)
      H_OBJ13%v = (F%v+G%v)
      H_OBJ14%v = (R13%v*1.2D+01)
      OpenAD_lin_101 = FOUR3RD
      G%v = (FOUR3RD*R02%v)
      double_tape(double_tape_pointer) = OpenAD_lin_100
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_101
      double_tape_pointer = double_tape_pointer+1
      OpenAD_aux_13 = (R03%v+R12%v)
      OpenAD_lin_102 = SQRT3
      F%v = (SQRT3*OpenAD_aux_13)
      H_OBJ10%v = (G%v-F%v)
      H_OBJ6%v = (F%v+G%v)
      OpenAD_lin_103 = TWO3RD
      G%v = (R02%v*TWO3RD)
      double_tape(double_tape_pointer) = OpenAD_lin_103
      double_tape_pointer = double_tape_pointer+1
      double_tape(double_tape_pointer) = OpenAD_lin_102
      double_tape_pointer = double_tape_pointer+1
      OpenAD_aux_14 = (R03%v-R12%v)
      OpenAD_lin_104 = SQRT3
      F%v = (SQRT3*OpenAD_aux_14)
      H_OBJ9%v = (G%v-F%v)
      H_OBJ7%v = (F%v+G%v)
      double_tape(double_tape_pointer) = OpenAD_lin_104
      double_tape_pointer = double_tape_pointer+1

C taping end
            our_rev_mode%arg_store=.FALSE.
            our_rev_mode%arg_restore=.FALSE.
            our_rev_mode%plain=.FALSE.
            our_rev_mode%tape=.FALSE.
            our_rev_mode%adjoint=.TRUE.
          end if
          if (our_rev_mode%adjoint) then
C            print*, " adjoint    ", our_rev_mode
            our_rev_mode%arg_store=.FALSE.
            our_rev_mode%arg_restore=.TRUE.
            our_rev_mode%plain=.FALSE.
            our_rev_mode%tape=.TRUE.
            our_rev_mode%adjoint=.FALSE.
C adjoint
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_0 = double_tape(double_tape_pointer)
      G%d = G%d+H_OBJ7%d
      F%d = F%d+H_OBJ7%d
      H_OBJ7%d = 0.0d0
      F%d = F%d-H_OBJ9%d
      G%d = G%d+H_OBJ9%d
      H_OBJ9%d = 0.0d0
      OpenAD_prp_11%d = OpenAD_prp_11%d+F%d*(OpenAD_Symbol_0)
      F%d = 0.0d0
      R12%d = R12%d-OpenAD_prp_11%d
      R03%d = R03%d+OpenAD_prp_11%d
      OpenAD_prp_11%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_1 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_2 = double_tape(double_tape_pointer)
      OpenAD_prp_9%d = OpenAD_prp_9%d+H_OBJ6%d
      F%d = F%d+H_OBJ6%d
      H_OBJ6%d = 0.0d0
      F%d = F%d-H_OBJ10%d
      OpenAD_prp_9%d = OpenAD_prp_9%d+H_OBJ10%d
      H_OBJ10%d = 0.0d0
      OpenAD_prp_10%d = OpenAD_prp_10%d+F%d*(OpenAD_Symbol_1)
      F%d = 0.0d0
      R02%d = R02%d+G%d*(OpenAD_Symbol_2)
      G%d = 0.0d0
      R12%d = R12%d+OpenAD_prp_10%d
      R03%d = R03%d+OpenAD_prp_10%d
      OpenAD_prp_10%d = 0.0d0
      G%d = G%d+OpenAD_prp_9%d
      OpenAD_prp_9%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_3 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_4 = double_tape(double_tape_pointer)
      R02%d = R02%d+G%d*(OpenAD_Symbol_3)
      G%d = 0.0d0
      R13%d = R13%d+H_OBJ14%d*(1.2D+01)
      H_OBJ14%d = 0.0d0
      OpenAD_prp_8%d = OpenAD_prp_8%d+H_OBJ13%d
      F%d = F%d+H_OBJ13%d
      H_OBJ13%d = 0.0d0
      F%d = F%d-H_OBJ12%d
      OpenAD_prp_8%d = OpenAD_prp_8%d+H_OBJ12%d
      H_OBJ12%d = 0.0d0
      R12%d = R12%d+F%d*(OpenAD_Symbol_4)
      F%d = 0.0d0
      G%d = G%d+OpenAD_prp_8%d
      OpenAD_prp_8%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_5 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_6 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_7 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_8 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_9 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_10 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_11 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_12 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_13 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_14 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_15 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_16 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_17 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_18 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_19 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_20 = double_tape(double_tape_pointer)
      G%d = G%d+H_OBJ11%d
      F%d = F%d+H_OBJ11%d
      H_OBJ11%d = 0.0d0
      F%d = F%d-H_OBJ8%d
      G%d = G%d+H_OBJ8%d
      H_OBJ8%d = 0.0d0
      R13%d = R13%d+G%d*(OpenAD_Symbol_5)
      G%d = 0.0d0
      R03%d = R03%d+F%d*(OpenAD_Symbol_6)
      F%d = 0.0d0
      M12%d = M12%d+R12%d*(OpenAD_Symbol_7)
      GG%d = GG%d+R12%d*(OpenAD_Symbol_8)
      LOC2%d = LOC2%d+R12%d*(OpenAD_Symbol_9)
      D12%d = D12%d+R12%d*(OpenAD_Symbol_10)
      R12%d = 0.0d0
      M03%d = M03%d+R03%d*(OpenAD_Symbol_11)
      GG%d = GG%d+R03%d*(OpenAD_Symbol_12)
      LOC2%d = LOC2%d+R03%d*(OpenAD_Symbol_13)
      D03%d = D03%d+R03%d*(OpenAD_Symbol_14)
      R03%d = 0.0d0
      M13%d = M13%d+R02%d*(OpenAD_Symbol_15)
      GG%d = GG%d+R02%d*(OpenAD_Symbol_16)
      LOC1%d = LOC1%d+R02%d
      R02%d = 0.0d0
      M02%d = M02%d+R13%d*(OpenAD_Symbol_17)
      GG%d = GG%d+R13%d*(OpenAD_Symbol_18)
      LOC1%d = LOC1%d+R13%d
      R13%d = 0.0d0
      OpenAD_prp_7%d = OpenAD_prp_7%d+LOC1%d*(OpenAD_Symbol_19)
      LOC2%d = LOC2%d+LOC1%d*(OpenAD_Symbol_20)
      LOC1%d = 0.0d0
      M23%d = M23%d+OpenAD_prp_7%d
      M01%d = M01%d+OpenAD_prp_7%d
      OpenAD_prp_7%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_21 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_22 = double_tape(double_tape_pointer)
      LOC1%d = LOC1%d+H_OBJ19%d
      F%d = F%d+H_OBJ19%d
      H_OBJ19%d = 0.0d0
      F%d = F%d-H_OBJ17%d
      LOC1%d = LOC1%d+H_OBJ17%d
      H_OBJ17%d = 0.0d0
      R00%d = R00%d+LOC1%d*(OpenAD_Symbol_21)
      LOC1%d = 0.0d0
      R00%d = R00%d+H_OBJ20%d*(OpenAD_Symbol_22)
      H_OBJ20%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_23 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_24 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_25 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_26 = double_tape(double_tape_pointer)
      F%d = F%d-H_OBJ18%d
      G%d = G%d+H_OBJ18%d
      H_OBJ18%d = 0.0d0
      G%d = G%d+H_OBJ15%d
      F%d = F%d+H_OBJ15%d
      H_OBJ15%d = 0.0d0
      OpenAD_prp_6%d = OpenAD_prp_6%d+F%d*(OpenAD_Symbol_23)
      F%d = 0.0d0
      M01%d = M01%d+OpenAD_prp_6%d*(OpenAD_Symbol_24)
      GG%d = GG%d+OpenAD_prp_6%d*(OpenAD_Symbol_25)
      D01%d = D01%d+OpenAD_prp_6%d
      OpenAD_prp_6%d = 0.0d0
      R11%d = R11%d-H_OBJ16%d
      LOC1%d = LOC1%d+H_OBJ16%d
      H_OBJ16%d = 0.0d0
      R11%d = R11%d+G%d
      LOC1%d = LOC1%d+G%d
      G%d = 0.0d0
      R00%d = R00%d+LOC1%d*(OpenAD_Symbol_26)
      LOC1%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_27 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_28 = double_tape(double_tape_pointer)
      LOC1%d = LOC1%d+H_OBJ4%d
      F%d = F%d+H_OBJ4%d
      H_OBJ4%d = 0.0d0
      F%d = F%d-H_OBJ2%d
      LOC1%d = LOC1%d+H_OBJ2%d
      H_OBJ2%d = 0.0d0
      R11%d = R11%d+LOC1%d*(OpenAD_Symbol_27)
      LOC1%d = 0.0d0
      R11%d = R11%d+H_OBJ5%d*(OpenAD_Symbol_28)
      H_OBJ5%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_29 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_30 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_31 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_32 = double_tape(double_tape_pointer)
      F%d = F%d-H_OBJ3%d
      G%d = G%d+H_OBJ3%d
      H_OBJ3%d = 0.0d0
      G%d = G%d+H_OBJ0%d
      F%d = F%d+H_OBJ0%d
      H_OBJ0%d = 0.0d0
      OpenAD_prp_5%d = OpenAD_prp_5%d+F%d*(OpenAD_Symbol_29)
      F%d = 0.0d0
      M23%d = M23%d+OpenAD_prp_5%d*(OpenAD_Symbol_30)
      GG%d = GG%d+OpenAD_prp_5%d*(OpenAD_Symbol_31)
      D01%d = D01%d+OpenAD_prp_5%d
      OpenAD_prp_5%d = 0.0d0
      R00%d = R00%d-H_OBJ1%d
      LOC1%d = LOC1%d+H_OBJ1%d
      H_OBJ1%d = 0.0d0
      R00%d = R00%d+G%d
      LOC1%d = LOC1%d+G%d
      G%d = 0.0d0
      R11%d = R11%d+LOC1%d*(OpenAD_Symbol_32)
      LOC1%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_33 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_34 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_35 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_36 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_37 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_38 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_39 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_40 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_41 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_42 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_43 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_44 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_45 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_46 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_47 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_48 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_49 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_50 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_51 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_52 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_53 = double_tape(double_tape_pointer)
      OpenAD_prp_4%d = OpenAD_prp_4%d+D01%d*(OpenAD_Symbol_33)
      LOC2%d = LOC2%d+D01%d*(OpenAD_Symbol_34)
      D01%d = 0.0d0
      M22%d = M22%d+R11%d*(OpenAD_Symbol_35)
      GG%d = GG%d+R11%d*(OpenAD_Symbol_36)
      LOC2%d = LOC2%d+R11%d*(OpenAD_Symbol_37)
      D11%d = D11%d+R11%d*(OpenAD_Symbol_38)
      R11%d = 0.0d0
      M33%d = M33%d+R00%d*(OpenAD_Symbol_39)
      GG%d = GG%d+R00%d*(OpenAD_Symbol_40)
      LOC2%d = LOC2%d+R00%d*(OpenAD_Symbol_41)
      D00%d = D00%d+R00%d*(OpenAD_Symbol_42)
      R00%d = 0.0d0
      LOC1%d = LOC1%d-G_OBJ3%d
      ADJ_M2%d = ADJ_M2%d-G_OBJ3%d
      G_OBJ3%d = 0.0d0
      M13%d = M13%d+OpenAD_prp_4%d
      M02%d = M02%d+OpenAD_prp_4%d
      OpenAD_prp_4%d = 0.0d0
      MATR3%d = MATR3%d+M23%d*(OpenAD_Symbol_43)
      MATR2%d = MATR2%d+M23%d*(OpenAD_Symbol_44)
      M23%d = 0.0d0
      MATR3%d = MATR3%d+M13%d*(OpenAD_Symbol_45)
      MATR1%d = MATR1%d+M13%d*(OpenAD_Symbol_46)
      M13%d = 0.0d0
      MATR2%d = MATR2%d+M12%d*(OpenAD_Symbol_47)
      MATR1%d = MATR1%d+M12%d*(OpenAD_Symbol_48)
      M12%d = 0.0d0
      MATR2%d = MATR2%d+M02%d*(OpenAD_Symbol_49)
      MATR0%d = MATR0%d+M02%d*(OpenAD_Symbol_50)
      M02%d = 0.0d0
      MATR1%d = MATR1%d+M01%d*(OpenAD_Symbol_51)
      MATR0%d = MATR0%d+M01%d*(OpenAD_Symbol_52)
      M01%d = 0.0d0
      OpenAD_prp_3%d = OpenAD_prp_3%d+LOC2%d*(2.0D00)
      LOC2%d = 0.0d0
      LOC1%d = LOC1%d+G_OBJ5%d*(2.0D00)
      G_OBJ5%d = 0.0d0
      LOC1%d = LOC1%d-G_OBJ4%d
      ADJ_M2%d = ADJ_M2%d+G_OBJ4%d
      G_OBJ4%d = 0.0d0
      ADJ_M3%d = ADJ_M3%d+LOC1%d*(OpenAD_Symbol_53)
      LOC1%d = 0.0d0
      LOC2%d = LOC2%d+OpenAD_prp_3%d
      OpenAD_prp_3%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_54 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_55 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_56 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_57 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_58 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_59 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_60 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_61 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_62 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_63 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_64 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_65 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_66 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_67 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_68 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_69 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_70 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_71 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_72 = double_tape(double_tape_pointer)
      LOC1%d = LOC1%d-G_OBJ0%d
      ADJ_M0%d = ADJ_M0%d-G_OBJ0%d
      G_OBJ0%d = 0.0d0
      LOC1%d = LOC1%d+G_OBJ2%d*(2.0D00)
      G_OBJ2%d = 0.0d0
      LOC1%d = LOC1%d-G_OBJ1%d
      ADJ_M0%d = ADJ_M0%d+G_OBJ1%d
      G_OBJ1%d = 0.0d0
      ADJ_M1%d = ADJ_M1%d+LOC1%d*(OpenAD_Symbol_54)
      LOC1%d = 0.0d0
      MATR0%d = MATR0%d+ADJ_M3%d*(OpenAD_Symbol_55)
      G%d = G%d+ADJ_M3%d*(OpenAD_Symbol_56)
      OpenAD_prp_2%d = OpenAD_prp_2%d+ADJ_M3%d*(OpenAD_Symbol_57)
      MATR3%d = MATR3%d+ADJ_M3%d*(OpenAD_Symbol_58)
      ADJ_M3%d = 0.0d0
      MATR1%d = MATR1%d+ADJ_M2%d*(OpenAD_Symbol_59)
      G%d = G%d+ADJ_M2%d*(OpenAD_Symbol_60)
      OpenAD_prp_2%d = OpenAD_prp_2%d+ADJ_M2%d*(OpenAD_Symbol_61)
      MATR2%d = MATR2%d+ADJ_M2%d*(OpenAD_Symbol_62)
      ADJ_M2%d = 0.0d0
      MATR2%d = MATR2%d+ADJ_M1%d*(OpenAD_Symbol_63)
      G%d = G%d+ADJ_M1%d*(OpenAD_Symbol_64)
      OpenAD_prp_2%d = OpenAD_prp_2%d+ADJ_M1%d*(OpenAD_Symbol_65)
      MATR1%d = MATR1%d+ADJ_M1%d*(OpenAD_Symbol_66)
      ADJ_M1%d = 0.0d0
      MATR3%d = MATR3%d+ADJ_M0%d*(OpenAD_Symbol_67)
      G%d = G%d+ADJ_M0%d*(OpenAD_Symbol_68)
      OpenAD_prp_2%d = OpenAD_prp_2%d+ADJ_M0%d*(OpenAD_Symbol_69)
      MATR0%d = MATR0%d+ADJ_M0%d*(OpenAD_Symbol_70)
      ADJ_M0%d = 0.0d0
      LOC2%d = LOC2%d+G%d*(OpenAD_Symbol_71)
      F%d = F%d+G%d*(OpenAD_Symbol_72)
      G%d = 0.0d0
      LOC1%d = LOC1%d+OpenAD_prp_2%d
      OpenAD_prp_2%d = 0.0d0
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_73 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_74 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_75 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_76 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_77 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_78 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_79 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_80 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_81 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_82 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_83 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_84 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_85 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_86 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_87 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_88 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_89 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_90 = double_tape(double_tape_pointer)
      double_tape_pointer = double_tape_pointer-1
      OpenAD_Symbol_91 = double_tape(double_tape_pointer)
      G%d = G%d+GG%d*(OpenAD_Symbol_73)
      GG%d = 0.0d0
      G%d = G%d+LOC2%d*(OpenAD_Symbol_74)
      LOC2%d = 0.0d0
      LOC1%d = LOC1%d+OBJ%d*(OpenAD_Symbol_75)
      F%d = F%d+OBJ%d*(OpenAD_Symbol_76)
      OBJ%d = 0.0d0
      G%d = G%d+LOC1%d*(OpenAD_Symbol_77)
      LOC1%d = 0.0d0
      D12%d = D12%d+F%d
      D03%d = D03%d+F%d
      F%d = 0.0d0
      M22%d = M22%d+D03%d*(OpenAD_Symbol_78)
      M11%d = M11%d+D03%d*(OpenAD_Symbol_79)
      D03%d = 0.0d0
      M33%d = M33%d+D12%d*(OpenAD_Symbol_80)
      M00%d = M00%d+D12%d*(OpenAD_Symbol_81)
      D12%d = 0.0d0
      MATR3%d = MATR3%d+M33%d*(OpenAD_Symbol_82)
      M33%d = 0.0d0
      MATR1%d = MATR1%d+M11%d*(OpenAD_Symbol_83)
      M11%d = 0.0d0
      M12%d = M12%d+D11%d*(2.0D00)
      D11%d = 0.0d0
      M03%d = M03%d+D00%d*(2.0D00)
      D00%d = 0.0d0
      M12%d = M12%d-G%d
      M03%d = M03%d+G%d
      G%d = 0.0d0
      MATR2%d = MATR2%d+M12%d*(OpenAD_Symbol_84)
      MATR1%d = MATR1%d+M12%d*(OpenAD_Symbol_85)
      M12%d = 0.0d0
      MATR3%d = MATR3%d+M03%d*(OpenAD_Symbol_86)
      MATR0%d = MATR0%d+M03%d*(OpenAD_Symbol_87)
      M03%d = 0.0d0
      OpenAD_prp_1%d = OpenAD_prp_1%d+MATR3%d*(OpenAD_Symbol_88)
      MATR3%d = 0.0d0
      OpenAD_prp_0%d = OpenAD_prp_0%d+MATR1%d*(OpenAD_Symbol_89)
      MATR1%d = 0.0d0
      X5%d = X5%d+OpenAD_prp_1%d*(2.0D00)
      X4%d = X4%d-OpenAD_prp_1%d
      X3%d = X3%d-OpenAD_prp_1%d
      OpenAD_prp_1%d = 0.0d0
      X2%d = X2%d+OpenAD_prp_0%d*(2.0D00)
      X1%d = X1%d-OpenAD_prp_0%d
      X0%d = X0%d-OpenAD_prp_0%d
      OpenAD_prp_0%d = 0.0d0
      MATR2%d = MATR2%d+M22%d*(OpenAD_Symbol_90)
      M22%d = 0.0d0
      MATR0%d = MATR0%d+M00%d*(OpenAD_Symbol_91)
      M00%d = 0.0d0
      X3%d = X3%d-MATR2%d
      X4%d = X4%d+MATR2%d
      MATR2%d = 0.0d0
      X0%d = X0%d-MATR0%d
      X1%d = X1%d+MATR0%d
      MATR0%d = 0.0d0

C adjoint end
            our_rev_mode%arg_store=.FALSE.
            our_rev_mode%arg_restore=.TRUE.
            our_rev_mode%plain=.FALSE.
            our_rev_mode%tape=.TRUE.
            our_rev_mode%adjoint=.FALSE.
          end if
        end subroutine head
